/**
 * 封装router
 */
import { createRouter, createWebHashHistory } from "vue-router";
import Home from './../components/Home.vue'
import Welcome from './../components/Welcome.vue'
import Login from './../components/Login.vue'

const routes = [
  {
    path: "/",
    name: "home",
    component: Home,
    meta: {
      title: "主页",
    },
    redirect: "/welcome",
    children: [
      {
        path: "/welcome",
        name: "welcome",
        component: Welcome,
        meta: {
          title: "欢迎页",
        },
      },
      {
        path: "/login",
        name: "login",
        component: Login,
        meta: {
          title: "登录页",
        },
      },
    ],
  },
];

// 创建router对象
const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
